package pl.edu.agh.iosr.gamblingzone.model;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@AttributeOverride(name="id",
		column=@Column(name="BET_ID"))
@Entity(name="BETS")
public class Bet extends IEntity{
	
	@ManyToOne(targetEntity=BettingSlip.class)
	@JoinColumn(name="BETTING_SLIP_ID", nullable=false)
	private BettingSlip bettingSlip;
	
	@ManyToOne
	@JoinColumn(name="PARTICIPANT_ID", nullable=false)
	private Participant participant;
	
	// TODO
//	@OneToMany
////	@JoinColumn(name="BET_ID", nullable=false)
//	@JoinColumn(name="BET_ID")
//	private List<AbstractEvent> events = new LinkedList<AbstractEvent>();
//
//	public List<AbstractEvent> getEvents() {
//		return events;
//	}

	public BettingSlip getBettingSlip() {
		return bettingSlip;
	}

	public void setBettingSlip(BettingSlip bettingSlip) {
		this.bettingSlip = bettingSlip;
	}

	public Participant getParticipant() {
		return participant;
	}

	public void setParticipant(Participant participant) {
		this.participant = participant;
	}
}
